<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="../css/common.css?01_38" />
		<link rel="stylesheet" type="text/css" href="../css/templet.css?01_38" />
		<link rel="stylesheet" type="text/css" href="../fonts/font-awesome.min.css?01_38" />
		<link rel="stylesheet" type="text/css" href="../mui/css/mui.css?01_38" />

		<!--公共js-->
		<script type="text/javascript" src="../common/js/jquery.js?01_38"></script>

		<!--插件-->
		<script type="text/javascript" src="../common/js/vue.min.js?01_38"></script>
		<script type="text/javascript" src="../common/js/mui.min.js?01_38"></script>

		<script type="text/javascript" src="../common/js/fastclick.js"></script>
		<script type="text/javascript" src="../common/js/common.js?01_38"></script>
		<script type="text/javascript" src="../common/js/my_common.js?01_38"></script>
		<script type="text/javascript" src="../common/js/main.js?01_38"></script>
		<script type="text/javascript" src="../common/js/app.js?01_38"></script>
	</head>

	<body>
		<header class="bg-red9 fff f-20 pad-t-10 pad-b-25 pad-l-10 pad-r-10">
			<div class="pa back" onclick="back();">
				<a></a>
			</div>
			<div class="center" data-l="1393"></div>
		</header>
		<div id="app" v-cloak>
			<div class="wrap_body vip_gold_detail">
				<div class="content pad-t-45 have-content">
					<template v-if="memory_result.length>0">
						<div class="list" v-for="item in memory_result">
							<div class="fiex pad-l-12 pad-r-12 pad-t-15 pad-b-15 f-12">
								<!--<div class="red9">{{item.amount}}</div>-->
								<div class="green" v-if="item.amount>=0">+{{item.amount}}</div>
								<div class="red9" v-else>{{item.amount}}</div>
								<div class="fiex1 f-right">
									<p>{{item.addtime}}</p>
									<p>{{b_lg[1275]}} {{item.nickname}}</p>
								</div>
							</div>
						</div>
						<div class="center c999 mag-t-10 no_more_data hide pad-b-10">{{b_lg['1151']}}</div>
						<div class="center c999 mag-t-10 loading hide pad-b-10">loading...</div>
						<div style="height: 30px;"></div>
					</template>

					<template v-else>
						<div class="center c999 f-15 no_record_info pa ">
							<p class="record_bg"></p>
							<p>{{b_lg[1255]}}</p>
						</div>
					</template>
				</div>
			</div>
		</div>

	</body>

	<script type="text/javascript">
		var app = null;
		var getCardID = localStorage.getItem("id");

		function fun1() {
			setlange_obj(); //加载头部语言包
			app = new Vue({
				el: "#app",
				data: {
					b_lg: global_lange, //语言包
					list: [],
					page_data: {
						lock: 1, //默认开启下拉刷新
						total: "", //总页数
						pag: "", //当前页数
					},
					result: {
						list: {}
					},
					memory_result: []
				},
				created: function() {
					this.init();
				},
				methods: {
					init: function() {
						//						common_ajax(1, {
						//							card_id: getCardID,
						//							type: 1,
						//							page: 0
						//						}, "get_member_card_amount_log", function(res) {
						//							app.list = res.result.list;
						//						})
						$th = this;
						$th.aj(1)
					},
					gotoart: function(e) {
						clicked(e);
					},
					aj: function(page) { //加载数据
						$(".loading").removeClass("hide")
						var th = this;
						common_ajax("1", {
							page: page,
							card_id: getCardID,
							pagesize: 10,
							type: 1,
						}, "get_member_card_amount_log", function(e) {
							th.page_data.total = e.result.total //总页数
							th.page_data.pag = e.result.page //当前页码
							$.each(e.result.list, function(k, v) {
								th.memory_result.push(v);
							});
							console.log("th.memory_result", th.memory_result)
							th.result = e.result;
							$(".loading").addClass("hide")

						})
						th.page_data.lock = 1
						th.xiala(); //开启下拉刷新
					},
					xiala: function() { //下拉刷新
						var winH = $(window).height(); //屏幕高度
						var $th = this;
						window.addEventListener('scroll', function(e) { //滚动事件
							var domH = $(".have-content").height(); //内容高度
							if((winH + $(window).scrollTop()) > domH - 40) {
								if(app.page_data.lock == 1) {
									app.page_data.lock = 0
									if(app.page_data.total <= app.page_data.pag) {
										if(app.page_data.total != 0 && domH != 0) {
											setTimeout(function() {
												$(".no_more_data").removeClass("hide")
											}, 800)
										}
									} else {
										$th.aj(++$th.page_data.pag);
									}
								}
							}
						}, true)
					},


				}

			})
		}
	</script>

</html>
